跳到主要内容

Fortran 部分数组操作

a(3:5) = 5
a(3:) = 5
a(3:5) = (/3, 4, 5/)
a(1:3) = b(4:6)
a(1:5:2) = 3 ! a(1) = a(3) = a(5) = 3
a(1:10) = a(10:1:-1)
a(:) = b(:,2)
a(:,:) = b(:,:,1)